package com.hrt.datasender.web.bcmonitorparamdict;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import com.btcode.web.core.annotation.RequestMapping;
import com.btcode.web.core.controller.Controller;
import com.hrt.common.web.DSRequestUnit;
import com.hrt.datasender.datadao.model.BcMonitorParamDictModel;

/**
 * 驱动
 * 
 * @author gislin
 *
 */
@RequestMapping(path = "BcMonitorParamDict")
public class BcMonitorParamDictController extends Controller {

    @RequestMapping(path = "create")
    public void create(ServletRequest arg0, ServletResponse arg1) throws IOException {

        BcMonitorParamDictModel model = DSRequestUnit.getModel(BcMonitorParamDictModel.class);
        BcMonitorParamDictService.getInstance().create(model);
        success(model);
    }

    @RequestMapping(path = "update")
    public void update(ServletRequest arg0, ServletResponse arg1) throws IOException {

        BcMonitorParamDictModel model = DSRequestUnit.getModel(BcMonitorParamDictModel.class);
        BcMonitorParamDictService.getInstance().update(model);
        success(model);
    }

    @RequestMapping(path = "delete")
    public void delete(ServletRequest arg0, ServletResponse arg1) throws IOException {

        String id = DSRequestUnit.getString("id");
        BcMonitorParamDictService.getInstance().delete(id);
        success("");
    }

    @RequestMapping(path = "getList")
    public void getList(ServletRequest arg0, ServletResponse arg1) throws IOException {

        List<BcMonitorParamDictModel> models = BcMonitorParamDictService.getInstance().getList();
        success(models);
    }

}
